/* ----------------------------------------------------------------------------
 * Arello Mobile
 * Fast 3d Engine
 * ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#pragma once
#include <lib3d/hard/RenderTarget.h>

#include <GLES/gl.h>
#include <GLES/glext.h>

namespace liba
{
namespace lib3d
{
namespace hard
{
namespace marmalade
{
	
class Hardware;

class RenderTarget : public hard::RenderTarget, public hard::TextureBase
{
protected:
	Hardware * hardware;
	GLuint     texture;
	GLuint     frameBuffer;
	GLuint     depthBuffer;
public:
	RenderTarget(Hardware * hardware, const Atom & name, int width, int height);
	virtual ~RenderTarget();
	virtual bool start_scene(double left, double right, double top, double bottom);
	virtual const int get_width()const;
	virtual const int get_height()const;
	virtual void invalidate();
	virtual void release();
	virtual bool is_valid();
	virtual bool set_in_hardware(int stage);
	virtual void get_data();
};
	
} // namespace marmalade
} // namespace hard
} // namespace lib3d
} // namespace liba
using namespace liba;